<?php
	require_once("../includes/public.inc.php");
	require_once ("./Public/jssdk/jssdk.php");
	$s = isset($_GET['s'])?$_GET['s']:'';
	$act = isset($_GET['act'])?$_GET['act']:'';
	$openid = isset($_GET['openid'])?$_GET['openid']:'';	
	//$sysconfig=mysql_fetch_array(mysql_query("select cappid,cappsecret,cdenglucode from ".DBQIAN."sys_config limit 1"));
	
	$jssdk = new JSSDK("wxe8ec27f5c1167aef", "e7619064f347a5f87809d9c31dbd78f3");
	$signPackage = $jssdk->GetSignPackage();
?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,user-scalable=no,maximum-scale=1,initial-scale=1">
<title>会员注册</title>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<link rel="stylesheet" type="text/css" href="../user/css/register.css" media="all">
<script>
	$(function(){
		$('#submit').click(function(){
			if (!$('#userID').val())
			{
				alert("请输入用户名！");return false;
			}
			if (!$('#userName').val())
			{
				alert("请输入真实姓名！");return false;
			}
		});
	});
</script>
<style type="text/css">
	img{
		max-width:100%;
		max-height:100%;
		max-width: 100%;
		height: auto;
		width: auto\9;
	}
</style>
</head>
<body style="background-color:#fd931b;">
<div class="pz-css"  style="margin-left:auto;margin-right:auto;">
<!--	<ul class="top-tool">-->
<!--		<li class="title">会员注册</li>-->
<!--		<li class="back"><a href="javascript:history.go(-1)"></a>-->
<!--		</li><li class="home"><a href="index.php"></a></li>-->
<!--	</ul>-->
	<br>
	<form action="userget_check.php?act=user&s=<?=$s?>&openid=<?=$openid?>" id="submit_form" method="post">
	 	<!-- <div class="pz-panel" style="background:#fff;color:#e50065;">
			<p>请认真填写以下内容,方便您积分、红包领取等。</p>
		</div> -->

	<div class="pz-panel" style="background-color: rgba(255, 237, 205, 1);width:86.8%;margin-left:auto;margin-right:auto;">
		<div style="width:100%;text-align:center;">
			<img src="./Public/images/logo.png" style="margin-left:auto; margin-right:auto;" width="96px"/><br>
			<span style="font-size:1.6rem;">会员注册</span>
		</div>
		<br/>
		<table class="list" border="0" cellspacing="0" width="100%">
		<tbody><tr>
			<td width="26%">手机号码 :</td>
			<td align="left" width="74%"><span class="span12" style="width:100%;"><input maxlength="25" style="width:100%;" placeholder="号码将成为您的登录帐号" id="userID" name="user" type="tel"></span></td>
		</tr>
		<tr>
			<td>真实姓名 :</td>
			<td align="left"><span class="span12" style="width:99%;"><input value="" maxlength="25" style="width:99%;"  placeholder="" id="userName" name="userName" type="text"></span></td>
		</tr>
		<tr>
			<td>Q&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Q :</td>
			<td align="left"><span class="span12" style="width:99%;"><input value="" maxlength="25" style="width:99%;"  placeholder="" id="qq" name="qq" type="text"></span></td>
		</tr>
		<!--<tr>
			<td>微&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;信 :</td>
			<td align="left"><span class="span12"><input value="" maxlength="20"  placeholder="*必填" id="weixin" name="weixin" type="text"></span></td>
		</tr>
		  <tr>
			<td colspan="2" height="80px;">具体地址(如果自动获取的位置不对，请填写下面的详细地址,只需填写市/区后面的地址)</td>
		</tr>-->
		<!-- <tr>
			<td>省&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;份：</td>
			<td align="left">
				<span class="span12">
					<select id="selProvince" name="province" onchange="provinceChange();"></select>
				</span>
			</td>
		</tr>
		<tr>
			<td>市&nbsp;&nbsp;&nbsp;/&nbsp;&nbsp;&nbsp;区：</td>
			<td align="left">
			<span class="span12">
				<select id="selCity" name="city"></select> 
			</span></td>
		</tr>-->
		<!-- <tr>
			<td>自动获取：</td>
			<td align="left">
				<span class="span12">
					<input value="" placeholder="" id="autoaddress" name="autoaddress" type="text">
				</span>
			</td>
		</tr>
		<tr>
			<td>详细地址：</td>
			<td align="left"><span class="span12"><input value="" placeholder="如：xx区xxx街道xxx门牌号" id="address" name="address" type="text"></span></td>
		</tr> -->
		</tbody>
		</table>
		<br>
	</div>
	<input value=""  name="autoaddress" id="autoaddress" type="hidden">
	<input value=""  name="province" id="province" type="hidden">
	<input value=""  name="city" id="city" type="hidden">
	<input value=""  name="district" id="district" type="hidden">
	<input value=""  name="street" id="street" type="hidden">
     <input value="0"  name="credit"  type="hidden">  <input value="0"  name="s" type="hidden">
        <input value="1"  name="yz" type="hidden">
	<div class="group">
		<div class="span12" style="width:92%;margin-left:auto;margin-right:auto;"><button class="red" style="height:42px;background:#d45219;border:2px solid #fee49a;" type="submit" name="submit" id="submit">同意会员服务协议并注册</button></div>
	</div>
	</form>
	<form action="loginu.php" id="login_form"  method="get" style="width:100%;margin-left:auto;margin-right:auto;text-align:center;">
		<input value="<?=$s?>"  name="s" type="hidden">
		<input value="hy"  name="type" type="hidden">
		<input value="<?=$openid?>"  name="openid" type="hidden">
		<div class="group">
		<div class="span12" style="width:92%;margin-left:auto;margin-right:auto;">
			<button class="yellow" style="height:42px;background:#fe0000;border:2px solid #fee49a;" type="submit">已注册用户请登录</button>
		</div></div>
	</form>
	<div class="pz-panel" style="background:#fd931b;border:0px;font-size:16px; color:#655c5c;width:92%;margin-left:auto;margin-right:auto;">
		<h3 style="font-size:16px;">温馨提示：</h3>
		<p>尊敬的用户，您好！欢迎注册会员，请仔细阅读<a style="color: rgb(0, 232, 229);" href="xieyi.php?id=1">《 会员注册服务使用协议 》</a></p>
	</div>
	
<script src="../user/js/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="../user/js/sel.js"   charset="gb2312"></script>
</div>
<script>
  /*
   * 注意：
   * 1. 所有的JS接口只能在公众号绑定的域名下调用，公众号开发者需要先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”。
   * 2. 如果发现在 Android 不能分享自定义内容，请到官网下载最新的包覆盖安装，Android 自定义分享接口需升级至 6.0.2.58 版本及以上。
   * 3. 常见问题及完整 JS-SDK 文档地址：http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
   *
   * 开发中遇到问题详见文档“附录5-常见错误及解决办法”解决，如仍未能解决可通过以下渠道反馈：
   * 邮箱地址：weixin-open@qq.com
   * 邮件主题：【微信JS-SDK反馈】具体问题
   * 邮件内容说明：用简明的语言描述问题所在，并交代清楚遇到该问题的场景，可附上截屏图片，微信团队会尽快处理你的反馈。
   */
  wx.config({
    debug: false,
    appId: '<?php echo $signPackage["appId"];?>',
    timestamp: <?php echo $signPackage["timestamp"];?>,
    nonceStr: '<?php echo $signPackage["nonceStr"];?>',
    signature: '<?php echo $signPackage["signature"];?>',
    jsApiList: [
        // 所有要调用的 API 都要加到这个列表中
        'checkJsApi',
        'openLocation',
        'getLocation'
      ]
});
  wx.ready(function () {
		wx.getLocation({
	      success: function (res) {
	       // alert(JSON.stringify(res));
			var latitude = res.latitude; // 纬度，浮点数，范围为90 ~ -90
	        var longitude = res.longitude; // 经度，浮点数，范围为180 ~ -180。
	        var speed = res.speed; // 速度，以米/每秒计
	        var accuracy = res.accuracy; // 位置精度
			var latlon = latitude+','+longitude;

			//baidu
			var url = "http://api.map.baidu.com/geocoder/v2/?ak=C93b5178d7a8ebdb830b9b557abce78b&callback=renderReverse&location="+latlon+"&output=json&pois=0";
			$.ajax({ 
				type: "GET", 
				dataType: "jsonp", 
				url: url,
				beforeSend: function(){
					$("#autoaddress").html('正在定位...');
				},
				success: function (json) { 
					if(json.status==0){
						$("#autoaddress").val(json.result.formatted_address);
						$("#province").val(json.result.addressComponent.province);
						$("#city").val(json.result.addressComponent.city);
						$("#district").val(json.result.addressComponent.district);
						$("#street").val(json.result.addressComponent.street);
					}
				},
				error: function (XMLHttpRequest, textStatus, errorThrown) { 
					$("#autoaddress").val(latlon+"地址位置获取失败"); 
				}
			});

	      },
	      cancel: function (res) {
	        alert('用户拒绝授权获取地理位置');
	      }
	    });
	});
	
	function getLocation()
	{
		
	}
</script>
</body>
</html>